package model;

import java.util.Date;

public class Person {

	public static class PersonBuilder {

		private String firstName;
		private String lastName;
		private Address address;
		private Date birthday;

		public PersonBuilder firstName(String firstName) {
			this.firstName = firstName;
			return this;
		}

		public PersonBuilder lastName(String lastName) {
			this.lastName = lastName;
			return this;
		}

		public PersonBuilder address(Address address) {
			this.address = address;
			return this;
		}

		public PersonBuilder birthday(Date birthday) {
			this.birthday = birthday;
			return this;
		}

		public Person build() {
			return new Person(this);
		}
	}

	private int version;
	private int personId;
	private String firstName;
	private String lastName;
	private Address address;
	private Date birthday;

	protected Person(PersonBuilder builder) {
		firstName = builder.firstName;
		lastName = builder.lastName;
		address = builder.address;
		birthday = builder.birthday;
	}

	public int getVersion() {
		return version;
	}

	public int getPersonId() {
		return personId;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public Address getAdress() {
		return address;
	}

	public void setAdress(Address adress) {
		this.address = adress;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

}
